package com.c.util;

import com.c.pojo.enums.ResultEnum;
import com.c.pojo.vo.ResultVo;

/**
 * @author bysun
 */
public class ResultUtil {

    public static ResultVo success(Object object) {
        return new ResultVo(ResultEnum.SUCCESS.getCode(), ResultEnum.SUCCESS.getMsg(), object);
    }

    public static ResultVo success() {
        return success(null);
    }

    public static ResultVo error() {
        return error(ResultEnum.DEFAULT_ERROR);
    }

    public static ResultVo error(ResultEnum resultEnum) {
        return new ResultVo(resultEnum.getCode(), resultEnum.getMsg(), null);
    }


}
